﻿using DomainEventDemo.Plans.IntegrationEvents;
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Uow;

namespace DomainEventDemo.Orders.IntegrationEventHandlers
{
    public class PlanCreatedIntegrationEventHandler : IDistributedEventHandler<PlanCreatedIntegrationEvent>, ITransientDependency
    {
        [UnitOfWork]
        public virtual Task HandleEventAsync(PlanCreatedIntegrationEvent eventData)
        {
            Console.WriteLine($"计划已创建事件已到达：{eventData.Id}.{DateTime.Now}");
            return Task.CompletedTask;
        }
    }
}
